<?php /* Smarty version 2.6.26, created on 2013-12-24 10:39:00
         compiled from admin/requests.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'geturl', 'admin/requests.html', 3, false),array('modifier', 'count', 'admin/requests.html', 64, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'admin/header.html', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<div>
    <form method="post" action="<?php echo smarty_function_geturl(array('action' => 'requests'), $this);?>
" id="filter-form">
        <fieldset> Категории
            <select name='cats_filter[]' id='cats_filter' data-placeholder="Выбрать категорию" class="chosen-select_cat" multiple style="width:300px;" tabindex="4">
                <option value="0" ></option>
                <?php $_from = $this->_tpl_vars['cats']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['cat']):
?>
                <?php if (in_array ( $this->_tpl_vars['cat']->getId() , $this->_tpl_vars['cats_filter'] )): ?>
                <option value="<?php echo $this->_tpl_vars['cat']->getId(); ?>
" selected='selected'><?php echo $this->_tpl_vars['cat']->name; ?>
</option>
                <?php else: ?>
                <option value="<?php echo $this->_tpl_vars['cat']->getId(); ?>
"><?php echo $this->_tpl_vars['cat']->name; ?>
</option>
                <?php endif; ?>
                <?php endforeach; endif; unset($_from); ?>
            </select>
            Проекты
            <select name='projects_filter[]' id='projects_filter' data-placeholder="Выбрать проект" class="chosen-select_project" multiple style="width:300px;" tabindex="4">
                <option value='0'></option>
                <?php $_from = $this->_tpl_vars['projects']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['project']):
?>
                <?php if (in_array ( $this->_tpl_vars['project']->getId() , $this->_tpl_vars['projects_filter'] )): ?>
                <option value="<?php echo $this->_tpl_vars['project']->getId(); ?>
" selected='selected'><?php echo $this->_tpl_vars['project']->name; ?>
</option>
                <?php else: ?>
                <option value="<?php echo $this->_tpl_vars['project']->getId(); ?>
"><?php echo $this->_tpl_vars['project']->name; ?>
</option>
                <?php endif; ?>
                <?php endforeach; endif; unset($_from); ?>
            </select>
            Пользователи
            <select name='users_filter[]' id='projects_filter' data-placeholder="Выбрать пользователя" class="chosen-select_project" multiple style="width:300px;" tabindex="4">
                <option value='0'></option>
                <?php $_from = $this->_tpl_vars['users']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['user']):
?>
                <?php if (in_array ( $this->_tpl_vars['user']->getId() , $this->_tpl_vars['users_filter'] )): ?>
                <option value="<?php echo $this->_tpl_vars['user']->getId(); ?>
" selected='selected'><?php echo $this->_tpl_vars['user']->company; ?>
</option>
                <?php else: ?>
                <option value="<?php echo $this->_tpl_vars['user']->getId(); ?>
"><?php echo $this->_tpl_vars['user']->company; ?>
</option>
                <?php endif; ?>
                <?php endforeach; endif; unset($_from); ?>
            </select>
            Статус:
            <select name='archive_filter' id='projects_filter' data-placeholder="Показывать все" class="chosen-select_project" style="width:300px;" tabindex="4">
                <?php if ($this->_tpl_vars['archive_filter'] == ''): ?>
                <option value="2" selected='selected'>Все</option>
                <?php else: ?>
                <option value="2">Все</option>
                <?php endif; ?>

                <?php if ($this->_tpl_vars['archive_filter'] == 0): ?>
                <option value="0" selected='selected'>На рассмотрении</option>
                <?php else: ?>
                <option value="0">На рассмотрении</option>
                <?php endif; ?>

                <?php if ($this->_tpl_vars['archive_filter'] == 1): ?>
                <option value="1" selected='selected'>Принятые</option>
                <?php else: ?>
                <option value="1">принятые</option>
                <?php endif; ?>

            </select>   
            <div class="submit">
                <input type="submit" value="Фильтр" />
            </div>
        </fieldset>
    </form>
</div>
<?php if (count($this->_tpl_vars['requests']) > 0): ?>
<table>
    <tr>
        <th>Контактное лицо</th>
        <th>Предприятие</th>
        <th>Тендер</th>
        <th>Дата подачи</th>
        <th>Статус</th>
        <th>Действие</th>
    </tr>
    <?php $_from = $this->_tpl_vars['requests']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['request']):
?>
    <tr>
        <td><?php echo $this->_tpl_vars['request']->user->manager; ?>
</td>
        <td><?php echo $this->_tpl_vars['request']->user->company; ?>
</td>
        <td><?php echo $this->_tpl_vars['request']->tender->name; ?>
</td>
        <td><?php echo $this->_tpl_vars['request']->dtime; ?>
</td>
        <td>
            <?php if ($this->_tpl_vars['request']->isApproved == 1): ?>
            Принята
            <?php else: ?>
            На рассмотрении
            <?php endif; ?>
        </td>
        <td>
            <a href="<?php echo smarty_function_geturl(array('route' => 'viewrequest','id' => $this->_tpl_vars['request']->getId()), $this);?>
">Просмотреть заявку</a>
        </td>
    </tr>
    <?php endforeach; endif; unset($_from); ?>
</table>
<?php else: ?>
<h3>По вашему запросу заявок не найдено</h3>
<?php endif; ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'admin/footer.html', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>